D_LIBMSLOG_LIBS	:=`pkg-config --libs	libmslog`
D_LIBMSLOG_INCLUDES	:=`pkg-config --cflags	libmslog`
D_LIBMSCOMMON_LIBS	:=`pkg-config --libs	libmscommon`
D_LIBMSCOMMON_INCLUDES	:=`pkg-config --cflags	libmscommon`
D_LIBPROTOCOL_LIBS	:=`pkg-config --libs	libmsprotocol`
D_LIBPROTOCOL_INCLUDES	:=`pkg-config --cflags	libmsprotocol`

C_BASE_INCLUDE:=${D_LIBMSLOG_INCLUDES} ${D_LIBMSCOMMON_INCLUDES}	${D_LIBPROTOCOL_INCLUDES} -I../ffmpeg
C_BASE_LIBS   :=${D_LIBMSLOG_LIBS}     ${D_LIBMSCOMMON_LIBS}	${D_LIBPROTOCOL_LIBS}	


libmsbitStream_CC=${CC}
libmsbitStream_SRC=${C_SRC}
libmsbitStream_CFLAGS=${C_BASE_INCLUDE} ${C_BASE_LIBS} ${C_INCLUDE} ${CFLAGS_SHARE} 

x8664:      libmsbitStream     install
x8664_gdb:  libmsbitStream_gdb install

libmsbitStream: 
	mkdir -p $(OUT_LIB)
	mkdir -p $(OUT_INCLUDE)
	mkdir -p $(OUT_INCLUDE)/flv
	mkdir -p $(OUT_INCLUDE)/mp3
	mkdir -p $(OUT_INCLUDE)/mpeg
	cp -fr src/*.h $(OUT_INCLUDE)
	cp -fr src/flv/flv.h $(OUT_INCLUDE)/flv/
	cp -fr src/mp3/*.h $(OUT_INCLUDE)/mp3/
	cp -fr src/mpeg/*.h $(OUT_INCLUDE)/mpeg/
	$($@_CC)  $($@_SRC)  $($@_CFLAGS)  -o $(OUT_LIB)/$(PROGRAM_NAME).so 
libmsbitStream_gdb: 
	mkdir -p $(OUT_LIB)
	mkdir -p $(OUT_INCLUDE)
	mkdir -p $(OUT_INCLUDE)/flv
	mkdir -p $(OUT_INCLUDE)/mp3
	mkdir -p $(OUT_INCLUDE)/mpeg
	cp -fr src/*.h $(OUT_INCLUDE)
	cp -fr src/flv/flv.h $(OUT_INCLUDE)/flv/
	cp -fr src/mp3/*.h $(OUT_INCLUDE)/mp3/
	cp -fr src/mpeg/*.h $(OUT_INCLUDE)/mpeg/
	$(libmsbitStream_CC)  $(libmsbitStream_SRC)  $(libmsbitStream_CFLAGS) ${DBG_FLAG} -o $(OUT_LIB)/$(PROGRAM_NAME).so  

install:
	mkdir -p  ${prefix_x8664}/lib/ 
	mkdir -p  ${prefix_x8664}/include/   
	mkdir -p  ${prefix_x8664}/lib/pkgconfig/ 
	cp -fr $(OUT_LIB)/$(PROGRAM_NAME).so 	${prefix_x8664}/lib/     
	cp -fr $(OUT_INCLUDE) 			${prefix_x8664}/include/	     
	cp -fr platform/$(PROGRAM_NAME).pc	${prefix_x8664}/lib/pkgconfig/
uninstall:
	rm -fr ${prefix_x8664}/lib/$(PROGRAM_NAME).so 
	rm -fr ${prefix_x8664}/include/$(PROGRAM_NAME)
	rm -fr ${prefix_x8664}/lib/pkgconfig/$(PROGRAM_NAME).pc